const express = require('express')
const app = express()

const m=(req,res,next)=>{
    console.log("局部生效的中间件")
    next()
}

app.get('/',m, (req, res) => {
    console.log("调用了home")
    res.send('home')
})
app.get('/user', (req, res) => {
    console.log("调用了user")
    res.send('userpage')
})

app.listen(8080, () => {
    console.log('express,at http://127.0.0.1:8080')
})